<?php
    //step4 闲家下注
        global $Room;
        $id=$connection->user['room'];
        act('initroom',$msg,$connection);
        $msg=array();
       $msg['id']='jsxx';
       $msg['html']=$Room[$id]['xx']['js'].'&nbsp;/&nbsp;'.$Room[$id]['xx']['zjs'].'&nbsp;局';
       act('html',$msg,$connection);

        $index=array();
        foreach ($Room[$id]['user'] as $key=>$connection3) {
            if($connection3->user['zt']==1){
                $index[]=array('index'=>$connection3->user['index'],'id'=>$connection3->user['id']);
            }
        }


        $msg=array();
        $msg['user']=$index;
        if($Room[$id]['user'][$connection->user['id']]->user['zt']=='1'){
            $msg['card']=$connection->user['card'];
            for($i=0;$i<5;$i++){
                if($msg['card'][$i]['zt']==0){
                    unset($msg['card'][$i]);
                }
            }
        }
        act('allfapai',$msg,$connection);

        act('mp3play','fapai',$connection);

         $msg=array();
        $msg['id']='operationButton';
        $msg['html']='';
        act('html',$msg,$connection);
         if($Room[$id]['type']!='10'){
        act('sss',$Room[$id]['bank']['index'],$connection);

        foreach ($Room[$id]['user'] as $connection3) {
            if($connection3->user['beishu']!='-1' && $connection3->user['zt']=='1'){
                $img='/app/img/X-'.$connection3->user['beishu'].'.png';
                $mp3='xia'.$connection3->user['beishu'];
                $msg=array();
                $msg['index']=$connection3->user['index'];
                $msg['img']=$img;
                act('showmemberTimesText',$msg,$connection);
                act('mp3play',$mp3,$connection);
            }
        }
        }


         if($Room[$id]['time7']>0){
                act('djs',$Room[$id]['time7'],$connection);
                $msg=array();
                $msg['id']='divRobBankerText';
                $msg['html']='等待摊牌';
                act('html',$msg,$connection);
         if($Room[$id]['user'][$connection->user['id']]->user['zt']=='1' && $Room[$id]['user'][$connection->user['id']]->user['tpzt']=='-1'){
                $msg=array();
                $msg['id']='operationButton';
                $msg['html']='<div class="gongg" style="display: block;">点击牌面翻牌</div>';
                act('html',$msg,$connection);
                act('fapaistart','',$connection);
         }
        }

         foreach ($Room[$id]['user'] as $connection3) {
                if($connection3->user['tpzt']!='-1' && $connection3->user['zt']=='1'){
                    $mp3='mp3niu'.$connection3->user['niu'];
                    if($connection3->user['id']==$connection->user['id']){
                        $msg=array();
                        $msg['card']=$connection3->user['card'];
                        if($connection3->user['sfniu']){
                            act('tanpaixx',$msg,$connection);
                        }
                        else{
                            act('tanpaixx2',$msg,$connection);
                        }
                    }
                    else{
                        $msg=array();
                        $msg['user']=$connection3->user;
                        $msg['card']=$connection3->user['card'];
                        act('tanpaixxother',$msg,$connection);
                    }

                    $img='/app/img/niu'.$connection3->user['niu'].'.png';
                    $msg=array();
                    $msg['index']=$connection3->user['index'];
                    $msg['img']=$img;

                    act('showmemberBull',$msg,$connection);
                    act('mp3play',$mp3,$connection);
                }
         }